package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.javapracticaltraining.entity.BaseData;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 
 * @TableName care_level
 */
@TableName(value ="care_level")
@Data
public class CareLevel implements BaseData {
    /**
     * 
     */
    @TableId(value = "level_id", type = IdType.AUTO)
    private Integer levelId;

    /**
     * 
     */
    @TableField(value = "level_name")
    private String levelName;

    /**
     * 
     */
    @TableField(value = "service_content")
    private String serviceContent;

    /**
     * 
     */
    @TableField(value = "price")
    private BigDecimal price;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CareLevel other = (CareLevel) that;
        return (this.getLevelId() == null ? other.getLevelId() == null : this.getLevelId().equals(other.getLevelId()))
            && (this.getLevelName() == null ? other.getLevelName() == null : this.getLevelName().equals(other.getLevelName()))
            && (this.getServiceContent() == null ? other.getServiceContent() == null : this.getServiceContent().equals(other.getServiceContent()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getLevelId() == null) ? 0 : getLevelId().hashCode());
        result = prime * result + ((getLevelName() == null) ? 0 : getLevelName().hashCode());
        result = prime * result + ((getServiceContent() == null) ? 0 : getServiceContent().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", levelId=").append(levelId);
        sb.append(", levelName=").append(levelName);
        sb.append(", serviceContent=").append(serviceContent);
        sb.append(", price=").append(price);
        sb.append("]");
        return sb.toString();
    }
}